<?php

if (!defined('PATH_HD'))
    exit('No direct script access allowed');

class CategoryControl extends Control {

    function index() {
        C('debug', 0);
        $db  = M("category");
        $data =$db->all();
        $this->assign("data", $data);
        $this->display();
    }
    function addshow(){
        $this->display();
    }
    function add(){
        C('debug',1);
        $db=M("category");
        if($db->add()){
            $this->success("添加栏目成功");
        }else{
            $this->error("添加栏目失败");
        }
    }

}

?>
